package com.riant.spring;

import com.riant.spring.bean.TestBean;
import com.riant.spring.config.JavaConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Classname Test
 * @Description TODO
 * @Date 2021/5/7 23:37
 * @Created by 张斌
 */
public class Test {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext1=new AnnotationConfigApplicationContext(JavaConfig.class);
        TestBean testBean=(TestBean) applicationContext1.getBean("testBean");
        System.out.println(testBean);
        TestBean testBean2=applicationContext1.getBean("testBean",TestBean.class);
        System.out.println(testBean2);

    }

}
